<div>
    <ol class="breadcrumb" >
        <li> <i class="fa fa-anchor"></i>
            &nbsp;短信管理
        </li>
        <li>短信发送记录记录</li>
        <li style="float:right"><a href={:U("Msg/add")} class="localRgihtBt"><b> 发送短信</b></a></li>
    </ol>
        <div class="panel">

            <div class="panel-heading" >
                <i class="fa fa-list"></i>
                &nbsp;&nbsp;短信管理信息表
            </div>
            <table  class="table table-bordered table-striped table-mcit" >
                <thead>
                <tr>
                    <th >
                        <empty name="is_order_name">
                            <button class='btn btn-block btn-mcit' type='submit' name='order_name' value=''>ID</button>
                            <else/>
                            <button class='btn btn-block btn-mcit btn-mcit-active'  type='submit' name='order_name' value=''>
                                <if condition="$order_name eq 1">
                                    <i class="fa fa-chevron-down"></i>
                                    <else/>
                                    <i class="fa fa-chevron-up"></i>
                                </if>
                                &nbsp;ID
                            </button>
                        </empty>
                    </th>
                    <th>
                        <empty name="is_order_stu_num">
                            <button class='btn btn-block btn-mcit' type='submit' name='order_stu_num' value=>用户</button>
                            <else/>
                            <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_stu_num' value=''>
                                <if condition="$order_stu_num eq 1">
                                    <i class="fa fa-chevron-down"></i>
                                    <else/>
                                    <i class="fa fa-chevron-up"></i>
                                </if>
                                &nbsp;用户
                            </button>
                        </empty>
                    </th>
                    <th>
                        <empty name="is_order_idcard">
                            <button class='btn btn-block btn-mcit' type='submit' name='order_idcard' value=>电话</button>
                            <else/>
                            <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_idcard' value=''>
                                <if condition="$order_idcard eq 1">
                                    <i class="fa fa-chevron-down"></i>
                                    <else/>
                                    <i class="fa fa-chevron-up"></i>
                                </if>
                                &nbsp;电话
                            </button>
                        </empty>
                    </th>
                
                    <th>
                        <empty name="is_order_tel">
                            <button class='btn btn-block btn-mcit' type='submit' name='order_tel' value=''>短信内容</button>
                            <else/>
                            <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_tel' value=>
                                <if condition="$order_tel eq 1">
                                    <i class="fa fa-chevron-down"></i>
                                    <else/>
                                    <i class="fa fa-chevron-up"></i>
                                </if>
                                &nbsp;短信内容
                            </button>
                        </empty>
                    </th>

                     <th>
                        <empty name="is_order_qq">
                            <button class='btn btn-block btn-mcit' type='submit' name='order_qq' value=''>是否成功</button>
                            <else/>
                            <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_qq' value=''>
                                <if condition="$order_qq eq 1">
                                    <i class="fa fa-chevron-down"></i>
                                    <else/>
                                    <i class="fa fa-chevron-up"></i>
                                </if>
                                &nbsp;是否成功
                            </button>
                        </empty>
                    </th>
                      <th>
                        <empty name="is_order_qq">
                            <button class='btn btn-block btn-mcit' type='submit' name='order_qq' value=''>失败原因</button>
                            <else/>
                            <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_qq' value=''>
                                <if condition="$order_qq eq 1">
                                    <i class="fa fa-chevron-down"></i>
                                    <else/>
                                    <i class="fa fa-chevron-up"></i>
                                </if>
                                &nbsp;失败原因
                            </button>
                        </empty>
                    </th>
                    <th>
                        <empty name="is_order_qq">
                            <button class='btn btn-block btn-mcit' type='submit' name='order_qq' value=''>发送时间</button>
                            <else/>
                            <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_qq' value=''>
                                <if condition="$order_qq eq 1">
                                    <i class="fa fa-chevron-down"></i>
                                    <else/>
                                    <i class="fa fa-chevron-up"></i>
                                </if>
                                &nbsp;发送时间
                            </button>
                        </empty>
                    </th>
                    <th>
                        <empty name="is_order_edit_self">
                            <button class='btn btn-block btn-mcit' type='submit' name='order_edit_self' value=''>操作</button>
                            <else/>
                            <button class='btn btn-block btn-mcit btn-mcit-active' type='submit' name='order_edit_self' value=''>
                                <if condition="$order_edit_self eq 1">
                                    <i class="fa fa-chevron-down"></i>
                                    <else/>
                                    <i class="fa fa-chevron-up"></i>
                                </if>
                                &nbsp;操作
                            </button>
                        </empty>
                    </th>
                </tr>
                </thead>
                <tbody >
                <empty name="rs">
                <td colspan="99" style="text-align:center" class="danger"> <strong><i class="fa fa-meh-o"></i>
                &nbsp;&nbsp;当前条件下没有数据</strong>
                </td>
                <else />
                    <volist name="rs" id="v">

                        <tr>
                            <td>{$v.id}</td>
                            <td>{$v.member.nickname}</td>
                            <td>{$v.member.phone}</td>

                            <td>{$v.content}</td>

                            <td><if condition="$v.isOk eq 1">成功<else />失败</if></td>
                           <td>{$v.reason}</td>
                            <td>{$v.msg_time}</td>
                            <td>
                                  <a class="btn btn-success btn-sm contentBtn"  href="#confirmContent" data-target="#confirmContent" data-toggle="modal" data-id='{$v.id}'>
                                    <i class="fa fa-eye"></i>
                                &nbsp;查看短信
                                </a>
                             <!--<a class="btn btn-success btn-sm" href="__APP__/Admin/Evcharger/add/id/{$data.id}">
                                    <i class="fa fa-edit"></i>
                                    &nbsp;添加电桩
                                </a>-->
                                <a class="btn btn-warning btn-sm" href="__URL__/update/id/{$data.id}">
                                <i class="fa fa-edit"></i>
                                &nbsp;备用
                                </a>
                                <a class="btn btn-sm btn-danger deleteBtn" href="#confirmDelete" data-target="#confirmDelete" data-toggle="modal" data-id='{$v.id}'>
                                    <i class="fa fa-trash-o"></i>
                                    &nbsp;删除</a>
                            </td>
                        </tr>
                    </volist>
                    </empty>
                <tr>
                             <!--</empty>-->
                    <td colspan="99" style="text-align:center">
                        <ul class="pagination">{$pageView}</ul>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
</div>
<!-- 删除分类 -->
<div id="confirmDelete" class="modal  fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 id="myModalLabel">是否确认删除？</h4>
            </div>
            <div class="modal-body">
                注意！此站点下所有电桩都将删除，删除后将不可恢复。
            </div>
            <div class="modal-footer">
                <a class="btn" data-dismiss="modal" aria-hidden="true" id="modelClose">关闭</a>
                <a class="btn btn-primary" id="confirmDeleteBtn">确定</a>
            </div>
        </div></div>
    <div class="hide" id="cache">1</div>
</div>

 <!--//详细内容-->
<div id="confirmContent" class="modal  fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 id="myContentHead">详细短信</h4>
            </div>
            <div class="modal-body" id="content_show">

            </div>
            <div class="modal-footer">
                <a class="btn" data-dismiss="modal" aria-hidden="true" id="Close">关闭</a>

            </div>
        </div></div>
    <div class="hide" id="cache_content">1</div>
</div>

<import file="js.jquery#chained" />
<script type="text/javascript">
    $(document).ready(function () {

        $(".deleteBtn").click(function (){
            var id = $(this).attr("data-id");
            //alert(id);
            $("#cache").val(id);
        });
        $("#confirmDeleteBtn").click(function (){
            var id = $("#cache").val();
            //alert(id);
            $.ajax({
                type:"post",
                url:'__URL__/del',
                data:'id='+id,
                success:function(data){
                    if(data == 1){
                        alert("删除成功！");
                    }else{
                        alert("删除失败，请重新提交！");
                    }
                    location.reload();
                }
            });
        });
        //查看详细短信
        $(".contentBtn").click(function(){
            var id = $(this).attr("data-id");
            //alert(id);
            $.ajax({
                type:"post",
                url:'__URL__/sel',
                data:'id='+id,
                success:function(data){
                    document.getElementById("content_show").innerHTML=data;

                }

            });
        });
    });
</script>